package com.manage.project.biz.controller;

import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.manage.framework.aspectj.lang.annotation.Log;
import com.manage.framework.aspectj.lang.enums.BusinessType;
import com.manage.project.biz.domain.BizTujianjiegouqingjie;
import com.manage.project.biz.service.IBizTujianjiegouqingjieService;
import com.manage.framework.web.controller.BaseController;
import com.manage.framework.web.domain.AjaxResult;
import com.manage.common.utils.poi.ExcelUtil;
import com.manage.framework.web.page.TableDataInfo;

/**
 Controller
 *
 * @author liutao
 *
 */
@RestController
@RequestMapping("/biz/tujianjiegouqingjie")
public class BizTujianjiegouqingjieController extends BaseController
{
    @Autowired
    private IBizTujianjiegouqingjieService bizTujianjiegouqingjieService;

    /**
     * 查询土建机构清洁列表
     */
//    @PreAuthorize("@ss.hasPermi('biz:tujianjiegouqingjie:list')")
    @GetMapping("/list")
    public TableDataInfo list(BizTujianjiegouqingjie bizTujianjiegouqingjie)
    {
        startPage();
        List<BizTujianjiegouqingjie> list = bizTujianjiegouqingjieService.selectBizTujianjiegouqingjieList(bizTujianjiegouqingjie);
        return getDataTable(list);
    }

    /**
     * 导出土建机构清洁列表
     */
//    @PreAuthorize("@ss.hasPermi('biz:tujianjiegouqingjie:export')")
    @Log(title = "土建机构清洁", businessType = BusinessType.EXPORT)
    @GetMapping("/export")
    public AjaxResult export(BizTujianjiegouqingjie bizTujianjiegouqingjie)
    {
        List<BizTujianjiegouqingjie> list = bizTujianjiegouqingjieService.selectBizTujianjiegouqingjieList(bizTujianjiegouqingjie);
        ExcelUtil<BizTujianjiegouqingjie> util = new ExcelUtil<BizTujianjiegouqingjie>(BizTujianjiegouqingjie.class);
        return util.exportExcel(list, "土建机构清洁数据");
    }

    /**
     * 获取土建机构清洁详细信息
     */
//    @PreAuthorize("@ss.hasPermi('biz:tujianjiegouqingjie:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(bizTujianjiegouqingjieService.selectBizTujianjiegouqingjieById(id));
    }

    /**
     * 新增土建机构清洁
     */
//    @PreAuthorize("@ss.hasPermi('biz:tujianjiegouqingjie:add')")
    @Log(title = "土建机构清洁", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody BizTujianjiegouqingjie bizTujianjiegouqingjie)
    {

        return toAjax(bizTujianjiegouqingjieService.insertBizTujianjiegouqingjie(bizTujianjiegouqingjie));
    }

    /**
     * 修改土建机构清洁
     */
    @Log(title = "土建机构清洁", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody BizTujianjiegouqingjie bizTujianjiegouqingjie)
    {
        return toAjax(bizTujianjiegouqingjieService.updateBizTujianjiegouqingjie(bizTujianjiegouqingjie));
    }

    /**
     * 删除土建机构清洁
     */
//    @PreAuthorize("@ss.hasPermi('biz:tujianjiegouqingjie:remove')")
    @Log(title = "土建机构清洁", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(bizTujianjiegouqingjieService.deleteBizTujianjiegouqingjieByIds(ids));
    }
}
